/**
 * 
 */
package es.uned.eped.parking;

import es.uned.eped.parking.enumerados.TType;
import es.uned.eped.tad.interfaces.IteratorIF;
import es.uned.eped.tad.lineales.ListDynamic;

/**
 * @author Paloma
 * Plazas del parking
 */
public class ParkingSpace implements ParkingElementIF{

private Integer space;
private Vehicle vehicle;
private TType   tipo;  

public ParkingSpace(Integer plaza, TType tipo) {
	this.space=plaza;
    this.vehicle = null;
    this.tipo = tipo;
}

public ParkingSpace(Integer plaza, TType tipo, Vehicle vehiculo){
	this.space 		= plaza;
    this.vehicle 	= vehiculo;
    this.tipo 		= tipo;
}

public Integer getSpace() {
	return space;
}

public void setSpace(Integer space) {
	this.space = space;
}

public TType getTipo() {
	return tipo;
}

public void setTipo(TType tipo) {
	this.tipo = tipo;
}

public Vehicle getVehicle() {
	return vehicle;
}

public void setVehicle(Vehicle vehicle) {
	this.vehicle = vehicle;
}

public void removeVehicle(){
	
}

@Override
public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((space == null) ? 0 : space.hashCode());
	result = prime * result + ((tipo == null) ? 0 : tipo.hashCode());
	result = prime * result + ((vehicle == null) ? 0 : vehicle.hashCode());
	return result;
}


@Override
public String toString() {
	return "" + space;
}

@Override
public boolean equals(Object obj) {
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	ParkingSpace other = (ParkingSpace) obj;
	if (space == null) {
		if (other.space != null)
			return false;
	} else if (!space.equals(other.space))
		return false;
	if (tipo != other.tipo)
		return false;
	if (vehicle == null) {
		if (other.vehicle != null)
			return false;
	} else if (!vehicle.equals(other.vehicle))
		return false;
	return true;
}

@Override
public IteratorIF getIterator() {
	
	return new IteratorSpace();
}

@Override
public ListDynamic<ParkingElementIF> getHijos() {
	// TODO Auto-generated method stub
	return null;
}

}
